﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RegisterationCommon.School;
using RegisterationCommon.Common;

namespace RegisterationSystem.Space_Education
{
    public partial class indicators : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.Form["action"] != "")
                {
                    switch (Request.Form["action"])
                    {
                        case "upd":
                            UpdSclCount();
                            break;
                    }
                }
            }
        }
        //修改学校招生数
        void UpdSclCount()
        {
            //获取修改ID和招生数
            string idlist = Request.Form["id"];
            string countlist = Request.Form["count"];
            string acountlist = Request.Form["acounts"];
            string bcountlist = Request.Form["bcounts"];
            string ccountlist = Request.Form["ccounts"];
            //遍历修改招生数
            string[] ids = idlist.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string[] counts = countlist.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            string[] acounts = acountlist.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            string[] bcounts = bcountlist.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            string[] ccounts = ccountlist.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < ids.Length; i++)
            {
                SchoolInfo s = new SchoolInfo();
                s.ID = Convert.ToInt32(ids[i]);
                s.Count = Convert.ToInt32(counts[i]);
                s.AInfo = acounts[i];
                s.BInfo = bcounts[i];
                s.CInfo = ccounts[i];
                s.MdfSchoolCount();
            }
        }
    }
}